void DrawGraph()
{
    gROOT->ProcessLine(".L lhcbStyle.C");
    TFile* inFile = new TFile("digi.root");
    TTree* inTree = (TTree*)inFile->Get("DigiInfo");

    const int NumOfPMT = 8;
    TGraph* graph[NumOfPMT] = {nullptr};
    for(int i = 0; i < NumOfPMT; ++i)
    {
        inTree->SetBranchAddress(TString::Format("PMTLineShape_%d", i), &(graph[i]));
    }

    TCanvas* can = new TCanvas("can", "", 1600, 600);
    can->Divide(4,2);
    Long64_t NumOfEntries = inTree->GetEntries();
    for(Long64_t entry = 0; entry < NumOfEntries; ++entry)
    {
        inTree->GetEntry(entry);
        for(int i = 0; i < NumOfPMT; ++i)
        {
            can->cd(i+1);
            graph[i]->GetXaxis()->SetTitle("Time (ns)");
            graph[i]->GetYaxis()->SetTitle("SigV (ADC)");
            graph[i]->Draw("AL");
            gPad->Modified(); 
            gPad->Update();
        }
        can->SaveAs(TString::Format("Plot/Event_%lld.png", entry));
    }
}